﻿
cls
echo off
echo createpackage.bat
echo source package			= [%1]
echo result file name		= [%2]
echo directory with content	= [%3]
echo *.proj toupdate from it= [%4]
echo loggin to file			= [%5]
echo current directory		= [%6]

echo on
echo start process.....
echo off
IF "%1"=="" (set p1="-") else (set p1=%1)
IF "%p1%"=="-" (
	echo set default package file name [package_empty.xml]
	set pxml=x package_empty.xml
) else (
	set pxml=x %p1%
)
IF "%2"=="" (set p2="-") else (set p2=%2)
IF "%p2%"=="-" (
	echo set zip archive file name [empty]	
	set pzip=
) else (   
	set pzip=z %p2%
)
IF "%3"=="" (set p3="-") else (set p3=%3)
IF "%p3%"=="-" (
	echo set default content dir [content]	
	set pdir=d StaticContent
) else (
	set pdir=d %p3%
)
IF "%1"=="" (set p4="-") else (set p4=%4)
IF "%p4%"=="-" (
	echo set don't process project to update content directory with new content	
	set proj=
) else (
	set proj=p %p4%
)
IF "%5"=="" (set p5="-") else (set p5=%5)
IF "%p5%"=="-" (
	echo set default log file name [empty]	
	set plog=
) else (
	set plog=l %p5%
)
IF "%6"=="" (set p6="-") else (set p6=%6)
IF "%p6%"=="-" (
	rem echo set current dir [content]	
) else (
   echo set current dir [%p6%]
   cd %p6%
)
IF "%7"=="" (set p7="-") else (set p7=%7)
IF "%p7%"=="-" (
	rem echo don't delete previous info 
) else (
   echo delete previous info
   del %p6%%p7%_bkp.zip   
   del %p6%%p7%.zip
)
echo    
echo result params:
echo source package			= [%pxml%]
echo result file name		= [%pzip%]
echo directory with content	= [%pdir%]
echo *.proj toupdate from it= [%proj%]
echo loggin to file			= [%plog%]
echo on
bin\debug\package.exe %pxml% %pzip% %pdir% %proj% %plog%




